﻿@using Db8.Data
@using Db8.ViewModels
@model ClaimViewModel
<div class="claim-box">
    
    @if (ViewBag.EnableEdit)
    {
        <div class="display-field statement">
            @Html.DisplayFor(model => model.Claim.Statement)
        </div>
        <div class="display-field abstract">
            @Html.Raw(Model.AbstractHtml)
        </div>
        <div>
        @foreach (string kw in Model.Claim.ClaimKeywords.Select(ck => ck.Keyword.Value))
        {
            <a href="@Url.Action("Keyword", "Claim", new { id = kw })"><span class="keyword">@kw</span></a>
        }
        </div>
        if (User.Identity.IsAuthenticated)
        {
        <span class="edit-stamp">
            <a href="@Model.Claim.CreatedByUser.Link" target="_blank">@Model.Claim.CreatedByUser.Name</a> <span class="datetime">@Model.Claim.CreatedDt</span>
        </span>
            if (Model.Claim.CreatedDt != Model.Claim.ModifiedDt)
            {
        <span class="edit-stamp">
            <a href="@Model.Claim.ModifiedByUser.Link" target="_blank">@Model.Claim.ModifiedByUser.Name</a> <span class="datetime">@Model.Claim.ModifiedDt</span>
        </span>
            }
        }
        if (User.IsInRole(Db8.Db8Roles.CONTENT_ADMINISTRATOR))
        {
        <span class="edit-button" title="Edit" load-action="@Url.Action("Edit", "Claim", new { id = Model.Claim.ClaimId })">
            <img src="@Url.Content("~/images/pencil.png")" />
        </span>
        }
    }
    else
    {
        <div class="display-field statement">
            @Html.ActionLink(Model.Claim.Statement, "Details", new { id = Model.Claim.ClaimId, filter = Model.Filter })
        </div>
        @*<div class="display-field abstract" previewlength="300">
            @Html.Raw(Model.AbstractHtml)
        </div>*@
        <div>
        @foreach (string kw in Model.Claim.ClaimKeywords.Select(ck => ck.Keyword.Value))
        {
            <a href="@Url.Action("Keyword", "Claim", new { id = kw })"><span class="keyword">@kw</span></a>
        }
        </div>
    }
    


</div>
@if (ViewBag.EnableEdit)
{
    <br />
}